<extend name="./public/frame.html"/>
<block name="content">
    <form class="layui-form" action="{:url('lostRegister')}" method="post">
        <input type="text" name="lost_id" value="{$lost_id}" hidden/>
        <table class="layui-table">
            <volist name="fields" id="field">
                <tr>
                    <td>{$field}</td>
                    <switch name="key">
                        <case value="auth_type">
                            <td>{$auth_type[$info[$key]]}</td>
                        </case>
                        <case value="auth_status">
                            <td>{$auth_status[$info[$key]]}</td>
                        </case>
                        <case value="work_province">
                            <td>{$info['province']}{$info['city']}{$info['county']}</td>
                        </case>
                        <case value="avatar">
                            <td><img src="{$info[$key]}" alt="{$info['driver_name']}{$field}"/></td>
                        </case>
                        <default/>
                        <td>{$info[$key]}</td>
                    </switch>
                </tr>
            </volist>
            <tr>
                <td>丢失物品类型</td>
                <td>{$lost_goods_type}</td>
            </tr>
            <tr>
                <td>发现日期</td>
                <td>{$found_at}</td>
            </tr>
            <notempty name="goods_pic">
                <volist name="goods_pic" id="pic" key="i">
                    <tr>
                        <eq name="i" value="1">
                            <td rowspan="{$count_pic}">物品照片</td>
                        </eq>
                        <td class="layer-photos-demo"><img layer-src="{$pic}" src="{$pic}" alt="物品照片"/></td>
                    </tr>
                </volist>
            </notempty>
            <notempty name="remark">
                <tr>
                    <td>备注</td>
                    <td>{$remark}</td>
                </tr>
            </notempty>
            <tr>
                <td>上报司机姓名</td>
                <td>{$driver_name}</td>
            </tr>
            <tr>
                <td>上报时间</td>
                <td>{$created_time}</td>
            </tr>
            <tr>
                <td>失主姓名</td>
                <td><input name="owner_lost" class="layui-input" lay-verify="required" placeholder="请输入失主姓名"/></td>
            </tr>
            <tr>
                <td>失主联系方式</td>
                <td><input name="owner_phone" class="layui-input" lay-verify="required|phone" placeholder="请输入失主联系方式"/></td>
            </tr>
        </table>
        <button class="layui-btn" lay-submit="" lay-filter="submit">提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </form>
    <script>
        layui.use(['form','layer'], function(){
            var form = layui.form,
                layer = layui.layer;
            layer.photos({
                photos: '.layer-photos-demo'
                ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
                ,tab: function(pic, layero){
                    var str = "<div style='text-align: center'>"+pic.alt+"</div>";
                    layero.prepend(str);
                }
            });
            form.on('submit(submit)', function(data){

            });
        });
    </script>
</block>